<template>
  <el-form-item v-if="show" class="form-item" v-bind="_options">
    <template v-if="label" #label>
      <div class="inline-flex items-center">
        <div>
          <span class="inline items-center leading-[20px]">{{ label }}</span>
        </div>
        <el-tooltip
          v-if="tooltip"
          effect="dark"
          :content="tooltip"
          placement="top"
        >
          <SvgIcon icon-class="a-ziyuan1" class="ml-[4px] relative cursor-pointer"/>
        </el-tooltip>
      </div>
      <slot name="label"></slot>
    </template>
    <slot></slot>
  </el-form-item>
</template>
<script setup>
import SvgIcon from "@/components/SvgIcon/index.vue";
const props = defineProps({
  label: { type: String, default: '' },
  tooltip: { type: String, default: '' },
  show: { type: Boolean, default: true },
})

const _options = computed(() => {
  const option = {}
  return Object.assign(option, props)
})
</script>
